{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chiedere aiuto sui forum"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Install the Transformers, Datasets, and Evaluate libraries to run this notebook."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install datasets evaluate transformers[sentencepiece]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from transformers import AutoTokenizer, AutoModel\n",
    "\n",
    "model_checkpoint = \"distilbert-base-uncased\"\n",
    "tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)\n",
    "model = AutoModel.from_pretrained(model_checkpoint)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "text = \"\"\"\n",
    "Generation One is a retroactive term for the Transformers characters that\n",
    "appeared between 1984 and 1993. The Transformers began with the 1980s Japanese\n",
    "toy lines Micro Change and Diaclone. They presented robots able to transform\n",
    "into everyday vehicles, electronic items or weapons. Hasbro bought the Micro\n",
    "Change and Diaclone toys, and partnered with Takara. Marvel Comics was hired by\n",
    "Hasbro to create the backstory; editor-in-chief Jim Shooter wrote an overall\n",
    "story, and gave the task of creating the characthers to writer Dennis O'Neil.\n",
    "Unhappy with O'Neil's work (although O'Neil created the name \"Optimus Prime\"),\n",
    "Shooter chose Bob Budiansky to create the characters.\n",
    "\n",
    "The Transformers mecha were largely designed by Shōji Kawamori, the creator of\n",
    "the Japanese mecha anime franchise Macross (which was adapted into the Robotech\n",
    "franchise in North America). Kawamori came up with the idea of transforming\n",
    "mechs while working on the Diaclone and Macross franchises in the early 1980s\n",
    "(such as the VF-1 Valkyrie in Macross and Robotech), with his Diaclone mechs\n",
    "later providing the basis for Transformers.\n",
    "\n",
    "The primary concept of Generation One is that the heroic Optimus Prime, the\n",
    "villainous Megatron, and their finest soldiers crash land on pre-historic Earth\n",
    "in the Ark and the Nemesis before awakening in 1985, Cybertron hurtling through\n",
    "the Neutral zone as an effect of the war. The Marvel comic was originally part\n",
    "of the main Marvel Universe, with appearances from Spider-Man and Nick Fury,\n",
    "plus some cameos, as well as a visit to the Savage Land.\n",
    "\n",
    "The Transformers TV series began around the same time. Produced by Sunbow\n",
    "Productions and Marvel Productions, later Hasbro Productions, from the start it\n",
    "contradicted Budiansky's backstories. The TV series shows the Autobots looking\n",
    "for new energy sources, and crash landing as the Decepticons attack. Marvel\n",
    "interpreted the Autobots as destroying a rogue asteroid approaching Cybertron.\n",
    "Shockwave is loyal to Megatron in the TV series, keeping Cybertron in a\n",
    "stalemate during his absence, but in the comic book he attempts to take command\n",
    "of the Decepticons. The TV series would also differ wildly from the origins\n",
    "Budiansky had created for the Dinobots, the Decepticon turned Autobot Jetfire\n",
    "(known as Skyfire on TV), the Constructicons (who combine to form\n",
    "Devastator),[19][20] and Omega Supreme. The Marvel comic establishes early on\n",
    "that Prime wields the Creation Matrix, which gives life to machines. In the\n",
    "second season, the two-part episode The Key to Vector Sigma introduced the\n",
    "ancient Vector Sigma computer, which served the same original purpose as the\n",
    "Creation Matrix (giving life to Transformers), and its guardian Alpha Trion.\n",
    "\"\"\"\n",
    "\n",
    "inputs = tokenizer(text, return_tensors=\"pt\")\n",
    "logits = model(**inputs).logits"
   ]
  }
 ],
 "metadata": {
  "colab": {
   "name": "Chiedere aiuto sui forum",
   "provenance": []
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
